<?php
import( 'de.ceus-media.framework.krypton.core.DefinitionView' );
/**
 *	Password View.
 *	@package		mv2.view.authentication
 *	@extends		CMF_Krypton_Core_DefinitionView
 *	@author			Christian Würker <Christian.Wuerker@CeuS-Media.de>
 *	@since			23.04.2007
 *	@version		0.1
 */
/**
 *	Password View.
 *	@package		mv2.view.authentication
 *	@extends		CMF_Krypton_Core_DefinitionView
 *	@author			Christian Würker <Christian.Wuerker@CeuS-Media.de>
 *	@since			23.04.2007
 *	@version		0.1
 */
class View_Authentication_Password extends CMF_Krypton_Core_DefinitionView
{
	/**
	 *	Builds Views.
	 *	@access		public
	 *	@return		string
	 */
	public function buildContent()
	{
		$auth		= $this->registry->get( 'auth' );
		if( !$auth->isAuthenticated() )
		{
			$content	= $this->buildContentSendPassword();
		}
		return $content;
	}

	/**
	 *	Builds Log in View.
	 *	@access		protected
	 *	@return		string
	 */
	protected function buildContentSendPassword()
	{
		$config			= $this->registry->get( 'config' );
		$request		= $this->registry->get( 'request' );
		$words			= $this->words['auth']['sendPassword'];

		$ui	= $this->buildForm( 'auth', 'sendPassword', 'auth', 'sendPassword' );
		$button_cancel	= UI_HTML_Elements::LinkButton( "?link=", $words['button_cancel'] );
		$button_send	= UI_HTML_Elements::Button( 'sendPassword', $words['button_send'] );
		$ui['field_button_cancel']	= UI_HTML_Elements::Field( '', $button_cancel );
		$ui['field_button_send']	= UI_HTML_Elements::Field( '', $button_send );
		$ui['form']			= UI_HTML_Elements::Form( 'password', "?link=".$request->get( 'link' ) );
		$ui['colgroup']		= UI_HTML_Elements::ColumnGroup( $words['colgroup'] );
		$ui['caption']		= UI_HTML_Elements::TableCaption( $words['caption'] );
		$ui['heading']		= $words['heading'];

		return $this->loadTemplate( 'authentication.sendPassword', $ui );
	}
	
	/**
	 *	Builds Extra Panel.
	 *	@access		public
	 *	@return		string
	 */
	public function buildExtra()
	{
//		return $this->loadContent( 'purchase.market.car.extra.html' );
	}
}
?>
